1. Field of the Invention
The present invention relates to an image encoding apparatus for use in a moving image or a still image and a method and an image decoding apparatus and a method.
2. Description of the Related Art
H.264 which is a representative video encoding standard system is a lossy compression system which performs orthogonal transform such as discrete cosine transform (DCT) on a prediction error signal between an input signal and a prediction image signal generated by intraframe prediction or motion compensation, and subjects the transform coefficients to compression processing based on quantization and encoding after the prediction error signal is transformed on such a frequency axis to acquire an encoded image. When the prediction image signal is generated, an interpolation filter for intra-frame prediction or motion compensation performs rounding processing with the same precision as the pixel bit depth of the input image after multiplying a plurality of pixels by a filter coefficient and adding them.
JP-A 2003-283872 (KOKAI) discloses a technique to control emphasis of encoding distortion due to correction of a display device by encoding an image obtained by enlarging a dynamic range of each color signal for each frame of an input image, and restoring the dynamic range to the original dynamic range after decoding.
Because, in H.264, a rounding error occurs in a process of rounding processing when a prediction signal is generated, it cannot be processed with enough precision in an interpolation filter for intra-prediction or motion compensation, resulting in increasing a prediction error signal and decreasing the encoding efficiency. In contrast, in the case of JP-A 2003-283872 (KOKAI), it is possible to decrease some of the above-mentioned rounding error by enlarging a dynamic range of an input image. However, in JP-A 2003-283872 (KOKAI), enlargement of the dynamic range is done simply within the range of bit precision of the input image, and also calculation precision cannot be improved enough because a rounding error occurs in enlarging the dynamic range.
JP-A H4-32667 (KOKAI) discloses a technique applied to a digital camera wherein an encoder and a decoder are provided integrally, and bit-shifting a bit depth of an input image in conformity to operation precision of DCT shared by the encoder and decoder. In this technique, if the encoder and decoder are provided separately and operation precisions of respective DCTS are different, the bit depth is bit-shifted in conformity to each of the operation precisions. As a result, the bit depth is shifted by the different number of bits, resulting in occurring mismatch.
It is an object of the present invention to provide an image encoding apparatus and an image encoding method and an image decoding apparatus and an image decoding method to improve an encoding efficiency by enhancing a precision of intra-prediction or motion compensation enough.